package cn.pms.po;

import java.util.HashSet;
import java.util.Set;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.Table;

/**
 * Year entity. @author MyEclipse Persistence Tools
 */
@Entity
@Table(name = "t_year", schema = "SCOTT")
public class Year implements java.io.Serializable
{
	private static final long serialVersionUID = -5732402724629823689L;
	// Fields
	private Integer year;
	private Set<Month> months = new HashSet<Month>(0);
	
	// Constructors
	/** default constructor */
	public Year()
	{}
	
	/** minimal constructor */
	public Year(Integer year)
	{
		this.year = year;
	}
	
	/** full constructor */
	public Year(Integer year, Set<Month> months)
	{
		this.year = year;
		this.months = months;
	}
	
	// Property accessors
	@Id
	@Column(name = "year", unique = true, nullable = false, precision = 32, scale = 0)
	public Integer getYear()
	{
		return this.year;
	}
	
	public void setYear(Integer year)
	{
		this.year = year;
	}
	
	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "year")
	public Set<Month> getMonths()
	{
		return this.months;
	}
	
	public void setMonths(Set<Month> months)
	{
		this.months = months;
	}
}
